1. Field of the Invention
The present invention relates to the field of assembly language programming and more particularly to USING range utilization in an assembly language program.
2. Description of the Related Art
Assembler language is a symbolic programming language that can be used to code instructions instead of coding in machine language. The Assembler language is the symbolic programming language that is closest to the machine language in form and content, and therefore is an excellent candidate for writing programs in which control of a program, down to the byte or bit level, is desired, or for writing subroutines for functions that are not provided by other symbolic programming languages, such as COBOL, FORTRAN, or PL/I.
Assembler language includes statements that represent either instructions or comments. The instruction statements are the working part of the language, and are divided into the following three groups: (1) machine instructions which are the symbolic representations of machine language instructions of instruction sets, (2) assembler instructions are requests to the assembler to perform certain operations during the assembly of a source module; for example, defining data constants, reserving storage areas, and defining the end of the source module, and (3) macro instructions or macros are requests to the assembler program to process a predefined sequence of instructions from which the assembler generates machine and assembler instructions, which then can be processed as if part of the original input in the source module.
Part of the power of assembler language programming is the ability to tightly control placement of data in specific areas of memory. In this regard, the USING assembler statement directs the assembler to map a particular data structure to a register that addresses the beginning of the structure. More specifically, the USING statement specifies a base address and range and assigns one or more base registers. Registers, in turn, can be loaded with virtual storage addresses that map to a place within an address space where the structure resides. Consequently, loading the base register with the base address establishes addressability in a control section.
Of note, the use of the USING statement is not without risk. Specifically, a problem arises when a USING statement in source code maps a base register to an area of storage, but the register subsequently is changed to contain a different address (or hold a value that is not an address) before the register can be used when fields in the structure are referenced by later instructions. In this instance, though it may be valid to change the contents of a register that has been previously identified to the assembler as a base register, more often than not, the change of the content of the register is the result of an inadvertent modification within the assembler code. Typically, the inadvertent modification of registers previously identified as base registers occurs within large sections of software that have grown complicated by many years of development and support modifications. Such problems often result in an abnormal end of task, also known as an “abend”, either when the register is referenced for the purposes of resolving the field in the structure, or at a later point in the execution of the program.
Problems such as this can take time and effort to diagnose, especially if the inadvertent modification of a register mapped in a USING statement results in run-time errors that do not present themselves as straightforward program checks. An incorrect flow of control in program execution can result and the error may not present itself for some time (if at all). Such problems are known to be the hardest to resolve since there is considerable reverse analysis required to step back through the program instructions and determine where the problem presented itself. In turn, the cost in terms of development and service time and expense can be considerable.